//
//  NewsSpeechStatusView.m
//  suRead
//
//  Created by lidi on 2018/6/3.
//  Copyright © 2018年 bao. All rights reserved.
//

#import "NewsSpeechStatusView.h"

@interface NewsSpeechStatusView()

@property(nonatomic,copy)void(^close)();
@property(nonatomic,copy)void(^next)();
@property(nonatomic,copy)void(^pre)();
@property(nonatomic,copy)void(^play)();
@property(nonatomic,copy)void(^tap)();
@end

@implementation NewsSpeechStatusView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    UITapGestureRecognizer *tp = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [self addGestureRecognizer:tp];
    self.userInteractionEnabled = YES;
}

- (void)setHandle:(void (^)())close next:(void (^)())next pre:(void (^)())pre play:(void (^)())play tap:(void (^)())tap {
    self.close = close;
    self.next = next;
    self.pre = pre;
    self.play = play;
    self.tap = tap;
}

- (void)tapAction:(UITapGestureRecognizer *)ges {
    if (self.tap) {
        self.tap();
    }
}

- (IBAction)closeAction:(id)sender {
    if (self.close) {
        self.close();
    }
}

- (IBAction)preAction:(id)sender {
    if (self.pre) {
        self.pre();
    }
}

- (IBAction)playAction:(id)sender {
    if (self.play) {
        self.play();
    }
}

- (IBAction)nextAction:(id)sender {
    if (self.next) {
        self.next();
    }
}

@end
